package com.logistics.pick.entity.model;
import com.logistics.pick.entity.domain.PickAndErpInvbill;
import com.logistics.utils.aspect.annotation.Dictionary;
import com.logistics.utils.tool.StringUtils;
import lombok.Data;

@Data
public class PickInfoRow {

    //拣配单ID
    private String pickId;
    //拣配单号
    private String pickCode;

    //状态
    private String status;

    //状态描述
    @Dictionary(key= "pick_status_type")
    private String statusName;

    //拣配人
    private String pickUser;

    //ERP单据号
    private String erpOrderNo;

    //ERP单据类型
    private String erpOrderType;

    //优先级
    private String priority;

    //配送终点
    private String deliveryEndStation;

    private String creator;

    private String createTime;

    private String updater;

    private String updateTime;

    PickInfoRow(){}

    public PickInfoRow(PickAndErpInvbill pickAndPickContainer){
        this.pickId = StringUtils.isNotNull(pickAndPickContainer.getId())
                ? String.valueOf(pickAndPickContainer.getId()) : "";
        this.pickCode = pickAndPickContainer.getCode();
        this.status = String.valueOf(pickAndPickContainer.getStatus());
        this.statusName = String.valueOf(pickAndPickContainer.getStatus());
        this.pickUser = pickAndPickContainer.getUpdater();
        this.erpOrderNo = pickAndPickContainer.getErpInvbillCode();
        this.priority = StringUtils.isNotNull(pickAndPickContainer.getPriority())
                ? String.valueOf(pickAndPickContainer.getPriority()): "";
        this.deliveryEndStation = pickAndPickContainer.getEndLocationName();
    }

    public static PickInfoRow build(PickAndErpInvbill pickAndErpInvbill){
        return new PickInfoRow(pickAndErpInvbill);
    }


}
